﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TekaMUD.Engine.Commands;

using TekaMUD.Engine.Blocks;
using TekaMUD.Engine.Framework;
using TekaMUD.Engine.ServerTasks;

namespace TekaMUD.Engine
{
	/// <summary>
	/// Queue for scheduled tasks. Supports Tasks that run on a periodic basis.
	/// </summary>
	public class SchedulerQueue
	{
		private static BlockingFibHeap<Task> queue = new BlockingFibHeap<Task>();
		private static object SyncRoot = new object();

		static SchedulerQueue()
		{
		}

		public static Node<Task> DequeueTask()
		{
			return queue.RemoveMin();
		}

		public static void Insert(Task task, long ticks)
		{
			queue.Insert(task, ticks);
		}
	}
}
